package com.xpec.c4.net.codec;

import java.nio.ByteBuffer;

import com.xpec.c4.service.utility.JavaZip;
import com.xpec.c4.service.utility.Utility;

/**
 * 
 * 
 * @author Bany
 *
 * @since 2008-11-27 下午06:42:50
 *
 */

public class ZipDecompressCodecExtend implements CodecExtend {
	
	@Override
	public ByteBuffer execute(ByteBuffer buffer, Object message) throws Exception {
		boolean compress=Utility.getBoolean(buffer);
		if(compress){
			ByteBuffer temp=JavaZip.decompress(buffer);
			return temp;
		}
		return buffer;
	}

}
